import request from '@/utils/request'
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

/**
 * 异步企业部门树
 */
export function getComAndOrgTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/orgInfo/queryOrgAndDep',
    method: 'post',
    data
  })
}
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/queryPage',
    method: 'post',
    data
  })
}
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/updateStatus',
    method: 'post',
    data
  })
}
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/get',
    method: 'post',
    data
  })
}
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/insert',
    method: 'post',
    data
  })
}
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/update',
    method: 'post',
    data
  })
}
export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/deleteById',
    method: 'post',
    data
  })
}

/**
 * 增加票数
 * @param data
 * @returns {*}
 */
export function addPacket(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/votingCandidate/addVirtualVotingLog',
    method: 'post',
    data
  })
}

